package com.yegs.hospital.dao;

import com.yegs.hospital.vo.Task;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.time.LocalDateTime;
import java.util.List;

@Repository
public interface TaskDao extends JpaRepository<Task, Long>, JpaSpecificationExecutor<Task> {

    Task findTaskByStatusEquals(String status);

    Task findTaskByStatusEqualsAndOpenIdEquals(String status, String openId);

    Task findFirstByOpenIdOrderByIdDesc(String openId);

    List<Task> findTasksByOpenIdOrderByIdDesc(String openId);






}
